package com.jasontools.http;

import java.util.HashMap;
import java.util.Map;

public final class HttpAjaxUrl {
	public final static String SERVER_URL = "http://live.mediahouse.com.cn/";
	//register
	public final static String REGISTER = "register";
	//login
	public final static String LOGIN = "login";
	//loginout
	public final static String LOGIN_OUT = "login_out_url";
	//
	public final static String DATA_LIVE = "data_lice";
	public final static String DATA_VIDEO = "data_video";
	
	public final static String URL_LIVE_BG = "bg_live";
	public final static String URL_USER_AVATAR = "user_avatar";
	public final static String URL_USER_AVATAR_BEGIN = "http://wuligang.qiniudn.com/liveroom/icon/";
	public final static String URL_USER_AVATAR_END = ".jpg?1413938929575&imageView2/1/w/60/h/60";
	
	
	public final static String URL_TEST = "account_test";
	public final static String URL_CATE = "living_cate";
	public final static String URL_HOTLIVE = "hot_live";
	public final static String URL_HOTVIDEO = "hot_video";
	public final static String URL_VIDEOPLAYER = "video_player_url";	
	
	public final static String URL_CHANNEL_ATTENTION = "channel_attention";	
	public final static String URL_VIDEO_COLLECTION = "video_collection";	
	
	private final static Map<String, String> mapUrl = new HashMap<String, String>();
	
	static {
		mapUrl.put(HttpAjaxUrl.REGISTER, "account/Register");
		mapUrl.put(HttpAjaxUrl.LOGIN, "account/Login");	
		mapUrl.put(HttpAjaxUrl.DATA_LIVE, "v2/channel/queryLive");
		mapUrl.put(HttpAjaxUrl.DATA_VIDEO, "v2/record/QueryRecord");
		mapUrl.put(HttpAjaxUrl.URL_LIVE_BG, "static/img/bg_room.jpg");
		mapUrl.put(HttpAjaxUrl.URL_USER_AVATAR, "http://wuligang.qiniudn.com/liveroom/icon/10.jpg?1413938929575&imageView2/1/w/60/h/60");
		mapUrl.put(URL_TEST, "v2/account/test");
		mapUrl.put(URL_CATE, "v2/cate/queryCate");
		mapUrl.put(URL_HOTLIVE, "v2/channel/queryHotChannel");
		mapUrl.put(URL_HOTVIDEO, "v2/record/queryHotRecord");
		mapUrl.put(URL_VIDEOPLAYER, "v2/record/getRecordUrl");		
		
		mapUrl.put(LOGIN_OUT, "account/Logout");
		
		mapUrl.put(URL_CHANNEL_ATTENTION, "v2/channel/channelAttention");
		mapUrl.put(URL_VIDEO_COLLECTION, "v2/record/recordAttention");
	}
	
	public static final String getServerUrl(String strAddr) {		
		return HttpAjaxUrl.SERVER_URL + HttpAjaxUrl.mapUrl.get(strAddr);
	}
	
	public static final String getServerUrlNoAdd(String strAddr) {
		return HttpAjaxUrl.mapUrl.get(strAddr);
	}
	
	public static final String getUserAvaterUrl(int userId) {
		return URL_USER_AVATAR_BEGIN + String.valueOf(userId) + URL_USER_AVATAR_END;
	}
}
